<?php


namespace part16_StateMode\Code3;

/**
 * 定义当前的状态
 */
class Context
{
    /**
     * @var State
     */
    private $state;

    public function __construct($state)
    {
        $this->state = $state;
    }

    public function getState()
    {
        return $this->state;
    }

    public function setState($state)
    {
        $this->state = $state;
    }

    public function request()
    {
        $this->state->handle($this);
    }
}